package phase6;

// import GlobalObjectId;
public class SegmentRunnerProxy
    extends SegmentRunner
{
	private static final long serialVersionUID = -4839963402187262866L;
	private GlobalObjectId globalObjectId;

    public SegmentRunnerProxy(GlobalObjectId globalObjectId){
    	super(false);
        this.globalObjectId = globalObjectId;
    }

    public static void main(java.lang.String[] p0){
    	System.err.println("Cannot call main() on a proxy");
        System.exit(1);
    }

    public phase6.SegmentRunner insertNewSegment(phase6.SegmentRunner p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "phase6.SegmentRunner";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "phase6.SegmentRunner", "insertNewSegment", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (phase6.SegmentRunner)result;
    }

    public boolean moveNodesToAnotherSegment(java.util.HashMap p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "java.util.HashMap";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "phase6.SegmentRunner", "moveNodesToAnotherSegment", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Boolean)result;
    }

    public boolean setNextSegment(phase6.SegmentRunner p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "phase6.SegmentRunner";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "phase6.SegmentRunner", "setNextSegment", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Boolean)result;
    }
    
    public boolean acceptNodes(java.util.HashMap p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "java.util.HashMap";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "phase6.SegmentRunner", "acceptNodes", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Boolean)result;
    }
    
    public cs340.stormtroopers.hypeerweb.Node getRandomNode(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "phase6.SegmentRunner", "getRandomNode", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (cs340.stormtroopers.hypeerweb.Node)result;
    }

    public int getSavedPortNumber(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "phase6.SegmentRunner", "getSavedPortNumber", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Integer)result;
    }

    public boolean setPreviousSegment(phase6.SegmentRunner p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "phase6.SegmentRunner";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "phase6.SegmentRunner", "setPreviousSegment", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Boolean)result;
    }
    
    public void shutdownAndWriteToDisk(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "phase6.SegmentRunner", "shutdownAndWriteToDisk", parameterTypeNames, actualParameters, true);
        PeerCommunicator.getSingleton().sendASynchronous(globalObjectId, command);
    }
    
    public java.lang.String getFilename(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "phase6.SegmentRunner", "getFilename", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (java.lang.String)result;
    }

    public boolean equals(java.lang.Object p0){
        String[] parameterTypeNames = new String[1];
        parameterTypeNames[0] = "java.lang.Object";
        Object[] actualParameters = new Object[1];
        actualParameters[0] = p0;
        Command command = new Command(globalObjectId.getLocalObjectId(), "java.lang.Object", "equals", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Boolean)result;
    }

    public java.lang.String toString(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "java.lang.Object", "toString", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (java.lang.String)result;
    }

    public int hashCode(){
        String[] parameterTypeNames = new String[0];
        Object[] actualParameters = new Object[0];
        Command command = new Command(globalObjectId.getLocalObjectId(), "java.lang.Object", "hashCode", parameterTypeNames, actualParameters, true);
        Object result = PeerCommunicator.getSingleton().sendSynchronous(globalObjectId, command);
        return (Integer)result;
    }

}
